<?php
/**
 * @name myMsSQL Project
 * @copyright GPL
 * @author Hakan DAMAR
 * @abstract Exception Handler
 */
require_once 'interface/IEXCEPTION.php';

final class EXCEPTION_HANDLER implements IEXCEPTION {
	private $errorCode;
	
	public static function _setMsg($errorCode){
		$this->errorCode = $errorCode;
		self::_getMsg();
	}
	
	public function _getMsg(){
		$controlList = self::controller();
		foreach ($controlList as $key => $value ){
			if($this->errorCode == $key){
				print($value);
				break;
			}
		}
	}
		
	public function controller(){
		$errorList = array("001"=>"Access Denied!",
						   "002"=>"Securty Error!",
						   "003"=>"Connection Error!",
						   "004"=>"Database Error",
						   "005"=>"Network Problem!",
						   "006"=>"Login Error",
						   "007"=>"Session Error",
						   "008"=>"SQL Command Error",
						   "009"=>"PHP Version Error"
						  );
		return $errorList;
	}
	
}

?>